package com.fau.wmbj.server.service.impl;

import com.fau.wmbj.server.entity.AuditLog;
import com.fau.wmbj.server.repository.AuditLogRepository;
import com.fau.wmbj.server.service.AuditLogService;
import com.fau.wmbj.server.service.base.BaseServiceImpl;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Service - 审计日志
 *
 * @author jiawei
 */
@Service
public class AuditLogServiceImpl extends BaseServiceImpl<AuditLog, Long> implements AuditLogService {

    @Resource
    private AuditLogRepository repository;

    @Override
    @Async
    @Transactional
    public void create(AuditLog auditLog) {
        super.save(auditLog);
    }

    @Override
    public void clear() {
        repository.deleteAll();
    }

}